package com.zx.wangyixinwen.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.TextView;

import com.zx.wangyixinwen.R;

/**
 * Created by dllo on 16/1/19.
 */
public class FoundActivity extends Activity implements View.OnClickListener {
    private WebView foundWebView;
    private TextView foundTextView;
    private ImageView foundImageView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_PROGRESS);
        setContentView(R.layout.found_activity);
        foundWebView = (WebView) findViewById(R.id.foundWebView);
        foundTextView = (TextView) findViewById(R.id.foundTextView);
        foundImageView = (ImageView) findViewById(R.id.foundImageView);
        foundImageView.setOnClickListener(this);
        Intent intent = getIntent();
        String url = intent.getStringExtra("url");
        String name = intent.getStringExtra("name");
        foundTextView.setText(name);
        // 自适应屏幕
        WebSettings settings = foundWebView.getSettings();
        //
        settings.setSupportZoom(true);
        settings.setDefaultFontSize(10);
        // 直接加载网页、图片并显示.
        foundWebView.loadUrl(url);

    }

    @Override
    public void onClick(View v) {

    }
}
